import formencode
from formencode import validators

class WebLead(formencode.Schema):
    allow_extra_fields = True

    first_name = validators.String(not_empty=True)
    last_name = validators.String(not_empty=True)
    email = validators.Email()
    phone = validators.String()
    club = validators.String(not_empty=True)

    chained_validators = [
        validators.RequireIfMissing('phone', missing='email')
    ]
